package com.zj.study.utils.validation.validator.decimalmax;


import com.zj.study.utils.validation.annotation.ValidateSupport;
import com.zj.study.utils.validation.annotation.constraint.DecimalMax;
import org.springframework.lang.NonNull;

/**
 * @author 谭耀飞
 * @since 2020.12.0
 */
@ValidateSupport(Double.class)
public class DecimalMaxValidatorForDouble extends AbstractDecimalMaxValidator<Double> {

  @Override
  boolean compare(@NonNull DecimalMax decimalMax, @NonNull Double value) {
    return value.compareTo(Double.valueOf(decimalMax.value())) <= 0;
  }

}
